blob: f78794c1882e63afeaedbcafc751b360e728e01f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
// app/evcp/data-room/owner-companies/[id]/users/new/page.tsx
import db from "@/db/db";
import { ownerCompanies } from "@/db/schema";
import { eq } from "drizzle-orm";
import { notFound } from "next/navigation";
import { Card, CardContent, CardHeader, CardTitle, CardDescription } from "@/components/ui/card";
import { OwnerCompanyUserForm } from "@/lib/owner-companies/owner-company-user-form";
export default async function NewOwnerCompanyUserPage({
params,
}: {
params: { id: string };
}) {
const companyId = parseInt(params.id);
const [company] = await db
.select()
.from(ownerCompanies)
.where(eq(ownerCompanies.id, companyId))
.limit(1);
if (!company) {
notFound();
}
return (
<div className="container mx-auto py-8 max-w-2xl">
<Card>
<CardHeader>
<CardTitle>{company.name} - 사용자 추가</CardTitle>
<CardDescription>
발주처 사용자를 등록합니다.
</CardDescription>
</CardHeader>
<CardContent>
<OwnerCompanyUserForm companyId={companyId} />
</CardContent>
</Card>
</div>
);
}
|